package com.zzy.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;



@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
// elasticsearch 启动的时候，如果没有索引会自动创建  zzyproduct
@Document(indexName = "zzyproduct")
public class ProductModel {

    @Id
    private Long id;
    @Field(type = FieldType.Text ) // ,analyzer = "ik_max_word"
    private String title;
    @Field(type = FieldType.Keyword)
    private String category;
    @Field(type = FieldType.Double)
    private Double price;
    @Field(type = FieldType.Keyword , index = false)
    private String images;

    private Integer pageSize;
    private Integer pageNum;

}
